<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	request.setCharacterEncoding("UTF-8");
 %>
<HTML>
<HEAD>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="${pageContext.request.contextPath}/admin/css/Style.css"
	rel="stylesheet" type="text/css" />
<script language="javascript"
	src="${pageContext.request.contextPath}/admin/js/public.js"></script>
<script type="text/javascript">
	function addPet() {
		window.location.href = "${pageContext.request.contextPath}/admin/pet/add.jsp";
	}
</script>
</HEAD>
<body>
	<br>
	<form id="Form1" name="Form1"
		action="${pageContext.request.contextPath}/pet/findPetByManyConditionServlet"
		method="post">
		<table cellSpacing="1" cellPadding="0" width="100%" align="center"
			bgColor="#f5fafe" border="0">
			<TBODY>
				<tr>
					<td class="ta_01" align="center" bgColor="#afd1f3"><strong>查
							询 条 件</strong>
					</td>
				</tr>
				<tr>
					<td>
						<table cellpadding="0" cellspacing="0" border="0" width="100%">
							<tr height="40">
								<td height="22" align="center" bgColor="#f5fafe" class="ta_01">
									宠物编号：</td>
								<td class="ta_01" bgColor="#ffffff"><input type="text"
									name="petId" size="15" value="" id="Form1_userName" class="bg" />
								</td>
								<td height="22" align="center" bgColor="#f5fafe" class="ta_01">
									宠物名字：</td>
								<td class="ta_01" bgColor="#ffffff"><input type="text"
									name="petName" size="15" value="" id="Form1_userName" class="bg" />
								</td>
							</tr>

							<tr height="40">
								<td height="22" align="center" bgColor="#f5fafe" class="ta_01">
									宠物品种：</td>
								<td class="ta_01" bgColor="#ffffff"><select name="petSpecies"
									id="petSpecies">
										<option value="" selected="selected">--选择宠物品种--</option>
										<option value="二哈">二哈</option>
										<option value="秋田">秋田</option>
										<option value="边牧">边牧</option>
										<option value="金毛">金毛</option>
										<option value="中华田园犬">中华田园犬</option>
										<option value="英国短毛猫">英国短毛猫</option>
										<option value="招财猫">招财猫</option>
										<option value="大熊猫">大熊猫</option>
										<option value="小龟龟">小龟龟</option>
										<option value="锦鲤">锦鲤</option>
										<option value="辣鸡">辣鸡</option>
										<option value="小黄鸭">小黄鸭</option>
										<option value="火狐">火狐</option>
										<option value="银狐">银狐</option>
								</select></td>
								<td height="22" align="center" bgColor="#f5fafe" class="ta_01">
									宠物生日：</td>
								<td class="ta_01" bgColor="#ffffff"><input type="text"
									name="petBirthday" size="10" value="" id="Form1_userName" class="bg"/>
							</tr>
							<tr height="40">
								<td height="22" align="center" bgColor="#f5fafe" class="ta_01">
									主人编号：</td>
								<td class="ta_01" bgColor="#ffffff"><input type="text"
									name="ownerId" size="10" value="" id="Form1_userName" class="bg"/>
								<td height="22" align="center" bgColor="#f5fafe" class="ta_01">
									医生编号：</td>
								<td class="ta_01" bgColor="#ffffff"><input type="text"
									name="doctorId" size="15" value="" id="Form1_userName" class="bg" />
								</td>
							</tr>

							<tr>
								<td width="100" height="22" align="center" bgColor="#f5fafe"
									class="ta_01"></td>
								<td class="ta_01" bgColor="#ffffff"><font face="宋体"
									color="red"> &nbsp;</font>
								</td>
								<td align="right" bgColor="#ffffff" class="ta_01"><br>
									<br></td>
								<td align="right" bgColor="#ffffff" class="ta_01">
									<button type="submit" id="search" name="search"
										value="查询" class="button_view">
										查询</button> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input
									type="reset" name="reset" value="重置"
									class="button_view" />
								</td>
							</tr>
						</table>
					</td>

				</tr>
				<tr>
					<td class="ta_01" align="center" bgColor="#afd1f3"><strong>宠物列表</strong>
					</TD>
				</tr>
				<tr>
					<td class="ta_01" align="right">
						<button type="button" id="add" name="add" value="添加;"
							class="button_add" onclick="addPet()">添加
						</button>
					</td>
				</tr>
				<tr>
					<td class="ta_01" align="center" bgColor="#f5fafe">
						<table cellspacing="0" cellpadding="1" rules="all"
							bordercolor="gray" border="1" id="DataGrid1"
							style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; WIDTH: 100%; WORD-BREAK: break-all; BORDER-BOTTOM: gray 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #f5fafe; WORD-WRAP: break-word">
							<tr
								style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #afd1f3">
								<td align="center" width="18%">宠物编号</td>
								<td align="center" width="8%">宠物名字</td>
								<td align="center" width="6%">宠物品种</td>
								<td align="center" width="6%">宠物生日</td>
								<td width="18%" align="center">主人编号</td>
								<td width="18%" align="center">医生编号</td>
								<td width="18%" align="center">描述</td>
								<td width="3%" align="center">编辑</td>

								<td width="3%" align="center">删除</td>
							</tr>

			<c:forEach items="${pets }" var="p">							
								<tr onmouseover="this.style.backgroundColor = 'white'"
									onmouseout="this.style.backgroundColor = '#F5FAFE';">
									<td style="CURSOR: hand; HEIGHT: 22px" align="center"
										width="18">${p.petId }</td>
									<td style="CURSOR: hand; HEIGHT: 22px" align="center"
										width="8%">${p.petName }</td>
									<td style="CURSOR: hand; HEIGHT: 22px" align="center"
										width="6%">${p.petSpecies }</td>
									<td style="CURSOR: hand; HEIGHT: 22px" align="center"
										width="6%">${p.petBirthday }</td>
									<td style="CURSOR: hand; HEIGHT: 22px" align="center" width="18%"><a 
										href="${pageContext.request.contextPath}/pet/findOwnerByPetIdServlet?petId=${p.petId }">
										${p.ownerId }</a></td>
									<td style="CURSOR: hand; HEIGHT: 22px" align="center"
										width="18%">${p.doctorId }</td>
									<td style="CURSOR: hand; HEIGHT: 22px" align="center"
										width="18%">${p.description }</td>
									<td align="center" style="HEIGHT: 22px" width="3%"><a
										href="${pageContext.request.contextPath}/pet/findPetByIdServlet?petId=${p.petId }">
											<img
											src="${pageContext.request.contextPath}/admin/images/i_edit.gif"
											border="0" style="CURSOR: hand"> </a>
									</td>

									<td align="center" style="HEIGHT: 22px" width="3%"><a
										href="${pageContext.request.contextPath}/pet/deletePetByIdServlet?petId=${p.petId }">
											<img
											src="${pageContext.request.contextPath}/admin/images/i_del.gif"
											width="16" height="16" border="0" style="CURSOR: hand">
									</a>
									</td>
								</tr>
					</c:forEach>	
						</table>
					</td>
				</tr>
			</TBODY>
		</table>
	</form>
</body>
</HTML>

